<html>
<head><meta charset="utf-8"><title>cargo test feature group without optional dependencies · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20test.20feature.20group.20without.20optional.20dependencies.html">cargo test feature group without optional dependencies</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222191806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20test%20feature%20group%20without%20optional%20dependencies/near/222191806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20test.20feature.20group.20without.20optional.20dependencies.html#222191806">(Jan 09 2021 at 22:00)</a>:</h4>
<p>Hi Cargo team. I have a feature <code>foo</code> which pulls in some optional dependencies:</p>
<div class="codehilite"><pre><span></span><code>foo = [&quot;a&quot;, &quot;b&quot;]
</code></pre></div>
<p>For reasons which are a bit difficult to explain, I want to run <code>cargo test --features foo</code> but without compiling in dependencies <code>a</code>, and <code>b</code>. Is this possible?</p>



<a name="222193986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20test%20feature%20group%20without%20optional%20dependencies/near/222193986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20test.20feature.20group.20without.20optional.20dependencies.html#222193986">(Jan 09 2021 at 23:01)</a>:</h4>
<p>Not without editing <code>Cargo.toml</code>. You defined a mandatory dependency of <code>foo</code> on <code>a</code> and <code>b</code>.</p>



<a name="222194630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20test%20feature%20group%20without%20optional%20dependencies/near/222194630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20test.20feature.20group.20without.20optional.20dependencies.html#222194630">(Jan 09 2021 at 23:20)</a>:</h4>
<p>Hi <span class="user-mention" data-user-id="133247">@bjorn3</span> , I can edit the <code>Cargo.toml</code>, that's no problem. But not sure what you mean by this, could you expand?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>